package personnel.department.dao.entity;


import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;


@Entity
@Table(name="employee")
public class Employee implements UniqueObject{

	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="id")
	private Long id;
	
	@Column(name="surname")
	private String surname;
	
	@Column(name="first_name")
	private String firstName;
	
	@Column(name="second_name")
	private String secondName;
	
	@ManyToOne(cascade=CascadeType.ALL)
	private StructualSubdivision subdivision;
	
	@OneToOne(cascade=CascadeType.ALL)
	private PersonalData personalData;
	
	@Column(name="notes")
	private String notes;
	
	@Embedded
	private Education education;
	
	@Embedded
	private Career career;
	
	@ManyToOne
	@JoinColumn(name="type")
	private EmployeeType type;

	public Employee() {
	}

	public Long getId() {
		return id;
	}

	public String getSurname() {
		return surname;
	}

	public String getFirstName() {
		return firstName;
	}

	public String getSecondName() {
		return secondName;
	}

	public StructualSubdivision getSubdivision() {
		return subdivision;
	}

	public PersonalData getPersonalData() {
		return personalData;
	}

	public String getNotes() {
		return notes;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public void setSecondName(String secondName) {
		this.secondName = secondName;
	}

	public void setSubdivision(StructualSubdivision subdivision) {
		this.subdivision = subdivision;
	}

	public void setPersonalData(PersonalData personalData) {
		this.personalData = personalData;
	}

	public void setNotes(String notes) {
		this.notes = notes;
	}

	public Education getEducation() {
		return education;
	}

	public void setEducation(Education education) {
		this.education = education;
	}

	public Career getCareer() {
		return career;
	}

	public void setCareer(Career career) {
		this.career = career;
	}

	public EmployeeType getType() {
		return type;
	}

	public void setType(EmployeeType type) {
		this.type = type;
	}


	
}
